Add Explain View run reports and RPG visualizer#84
Open
QingtaoLi1 wants to merge 24 commits into
Open
Conversation
Align update-rpg worktree comparisons and git diff outputs to the cmind workspace root so subdirectory workspaces do not duplicate RPG nodes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Report update_rpg results using the actual output fields, include raw git delta counts, and propagate semantic diff summaries so Explain View no longer shows zero/empty values for changed files and graph node counts.
Use package-aware imports for llm_usage_count_coarse and make intentional no-op/unsupported backend methods explicit so smoke stub detection no longer flags valid code.
Normalize list-valued feature paths before searching so search_rpg with feature/all scope no longer crashes when RPG nodes map to multiple paths. Add regression coverage for list-valued meta.path entries.
Clear stale sub-agent errors once a later iteration completes so successful rpg_edit reports do not surface recovered timeouts. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a shared “Explain View” HTML run-report system for multiple CoderMind commands, adds an RPG-focused HTML visualizer (including focused subgraph rendering), and improves git/workspace correctness for subdirectory workspaces (plus related rpg_edit and update_rpg wiring).
Changes:
- Add structured run event types + a sanitized HTML report renderer, then wire reporting into several commands (plan/update_graphs/code_gen/rpg_edit).
- Add/extend RPG visualization utilities, including generating focused subgraph HTML artifacts for reports.
- Fix subdirectory workspace git diff/path handling and propagate diff summary outputs through update_rpg reporting/tests.
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| CoderMind/utils/claude/llm_usage_count_coarse.py | Makes imports work both as a package module and as a standalone script. |
| CoderMind/tests/test_sync_from_commit_diff.py | Adds coverage for workspace-relative diff helper paths in subdir workspaces. |
| CoderMind/tests/test_run_report.py | New tests validating HTML escaping, sections, and rendering behaviors for Explain View reports. |
| CoderMind/tests/test_rpg_evolution.py | Asserts diff summary/file lists are stored on RPGEvolution output. |
| CoderMind/tests/test_rpg_edit_run_report.py | New tests for rpg_edit artifact persistence and review report publishing behavior. |
| CoderMind/tests/test_encoder_workspace_layout.py | Adds fixtures/tests for workspaces inside a git repo and update_rpg path prefix handling. |
| CoderMind/tests/test_encode_commands.py | Adds tests for meta git reads, diff summary return wiring, and list-valued meta.path search behavior. |
| CoderMind/templates/commands/rpg_edit.md | Updates rpg_edit template to merge back into the user’s base branch (not assumed main). |
| CoderMind/scripts/update_graphs.py | Wires Explain View reporting into update-rpg/sync flows and fixes worktree/subdir comparisons. |
| CoderMind/scripts/smoke_test.py | Extends PYTHONPATH setup to include scripts/ for package-aware imports during smoke tests. |
| CoderMind/scripts/run_batch.py | Adds Explain View batch report generation and prints report path in CLI output. |
| CoderMind/scripts/rpg/graph_query.py | Handles list-valued RPG meta.path entries during search (prevents crashes). |
| CoderMind/scripts/rpg/dep_graph.py | Adds missing derived field rpg_nodes to dep_graph derived field set. |
| CoderMind/scripts/rpg_visualize.py | Adds focused-graph extraction/filtering and focused HTML generation helpers. |
| CoderMind/scripts/rpg_encoder/run_update_rpg.py | Uses explicit cur_repo_dir for git meta reads; propagates diff summary/files into result. |
| CoderMind/scripts/rpg_encoder/run_encode.py | Attaches Explain View reports to encode results (success/error) with artifacts and verification. |
| CoderMind/scripts/rpg_encoder/rpg_evolution.py | Stores diff summary + diff file lists on RPG instances and returns diff_summary consistently. |
| CoderMind/scripts/rpg_edit/validate.py | Persists validate results to a standard artifact path for downstream reporting. |
| CoderMind/scripts/rpg_edit/review.py | Adds full Explain View report publishing for rpg_edit review (artifacts, deltas, focused graph). |
| CoderMind/scripts/rpg_edit/locate.py | Persists locate results to a standard artifact path for downstream reporting. |
| CoderMind/scripts/rpg_edit/code.py | Persists code-apply results and clears recovered sub-agent errors on successful completion. |
| CoderMind/scripts/rpg_edit/apply.py | Persists apply results (including before_state/rollback hints) and records explicit confirmation. |
| CoderMind/scripts/plan.py | Adds Explain View reporting for plan runs (check-only and full completion). |
| CoderMind/scripts/decoder_lang/python_backend.py | Marks backend methods abstract to avoid being treated as no-op stubs. |
| CoderMind/scripts/common/utils.py | Removes a redundant no-op __init__ implementation. |
| CoderMind/scripts/common/session_manager.py | Makes NullSessionManager.before explicitly return None. |
| CoderMind/scripts/common/run_report.py | New sanitized HTML report renderer shared across commands. |
| CoderMind/scripts/common/run_events.py | New structured event dataclasses + normalization helpers for report payloads. |
| CoderMind/scripts/common/paths.py | Adds standardized rpg_edit artifact file paths (validate/locate/apply). |
| CoderMind/scripts/common/git_utils.py | Adds workspace-aware diff helpers, diff-range helpers, and git root prefix detection. |
| CoderMind/scripts/check_code_gen.py | Adds Explain View report generation for code_gen progress status output. |
| CoderMind/pyproject.toml | Bumps package version to 0.1.10. |
| CoderMind/.gitignore | Ignores .claude/commands/ artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ractmethod decorators from PythonBackend
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 34 out of 34 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
zerorepo/rpg_gen/base/node/node.py:22
- RepoNode is now an ABC with abstract
is_file/is_dir, butDirectoryNodein this module only implementsis_dir. This makesDirectoryNodeabstract and instantiation (e.g.DirectoryNode(...)in skeleton/util helpers) will raiseTypeError: Can't instantiate abstract class DirectoryNode with abstract method is_fileat runtime.
HuYaSen
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a shared Explain View run-report system for CoderMind commands, a new
RPG visualizer, and a batch of
rpg_edit/ git-workspace correctness fixes.What's included
Explain View run reports (new)
scripts/common/run_events.py— structured event contract for command runsscripts/common/run_report.py— shared sanitized HTML report renderer(
write_command_report())plan.py,update_graphs.py, andrpg_edit/review.pytest_run_report.py,test_rpg_edit_run_report.pyRPG visualization (new)
scripts/rpg_visualize.py— interactive D3 visualizer rendering three views(Feat Graph tree, collapsible Dep Graph, and Feat↔Dep Mapping)
rpg_edit improvements
RPG_EDIT_APPLY_RESULT_FILEoutput alongsideRPG_EDIT_PLAN_FILEearlier timeouts
git / workspace correctness
git_utils: subdirectory-workspace-aware diffs and diff-range helpersupdate_rpg: worktree comparisons aligned to the cmind workspace root(fixes duplicated RPG nodes from subdirectory workspaces)
update_rpgreport now uses actual output fields + raw git delta countsBug fixes
dep_graph: missing propertymeta.pathentries (no longer crashes onfeature/allscope)GitRunner: fixmain_branchinit parameter; merge to base branch, notmainfalse stub detection
Test plan
uv run pytest CoderMind/tests/test_run_report.pyuv run pytest CoderMind/tests/test_rpg_edit_run_report.pyuv run pytest CoderMind/tests/test_encode_commands.py CoderMind/tests/test_encoder_workspace_layout.pyuv run pytest CoderMind/tests/test_sync_from_commit_diff.py CoderMind/tests/test_rpg_evolution.pyuv run python CoderMind/scripts/rpg_visualize.py rpg.json -o out.html